#! /usr/bin/env python
# encoding: utf-8

"""
The variables from cls.vars are then used to compute the task signature
and may trigger rebuilds
"""

from waflib.Task import Task
class foo(Task):
	vars = ['FLAGS']
	def run(self):
		print('the flags are %r' % self.env.FLAGS)

def options(ctx):
	ctx.add_option('--flags', default='-f', dest='flags', type='string')

def configure(ctx):
	pass

def build(ctx):
	ctx.env.FLAGS = ctx.options.flags
	tsk = foo(env=ctx.env)
	ctx.add_to_group(tsk)

